<template>
  <views class="logistics_list_detail">
    <!-- 托运单详情 -->
    <div class="note_info">
      <viewTitle :title="'托运单详情'"></viewTitle>
      <div class="note_info_flex">
        <el-form ref="form" label-width="auto">
          <el-form-item label="托运单号:">{{detail.logistics_no}}</el-form-item>
          <el-form-item v-if="detail.post_time" label="揽件时间:">{{detail.post_time}}</el-form-item>
          <el-form-item label="承运物流企业:">{{detail.company_name}}  <span class="cp more" @click="()=>{
                 this.$toRoutePath({
                  path: '/company_list/company_amend',
                  edit: true,
                query: {company_id:detail.company_id,look:1}
            });}">更多信息》</span></el-form-item>
        </el-form>
        <div class="btn-area">
          <div v-if="this.detail.is_dubious == 1" class="suspicious">可疑件</div>
          <div v-if="this.detail.handle_status == 1" class="processed">已处理</div>
        </div>
      </div>
    </div>
    <!-- 运输信息 -->
    <div class="carriage_info">
      <viewTitle :title="'运输信息'"></viewTitle>
      <div class="carriage_info_flex">
        <div class="flex flexR">
          <div style="flex: 1">
            <div class="title" v-if="detail.type == 0">{{detail.depart_region_name}}</div>
            <div class="title-content flex flexC flexJp">
              <div>
                <span>寄件人：{{detail.post_communicate_name}}</span>
                <span v-if="detail.type == 0" class="cp more" @click="()=>{
                 this.$toRoutePath({
                  path: '/member_list/member_list_detail?type=1&member_id',
                  edit: true,
                  query: {type:1,member_id:detail.member_id}
              })}">更多信息</span>
              </div>
              <div>
                <span>寄件人联系方式：</span>
                <span>{{detail.post_communicate_mobile}}</span>
              </div>
              <div v-if="detail.type != 0">
                <span>寄件地址：</span>
                <span>{{detail.depart_address}}</span>
              </div>
            </div>
          </div>

          <div style="flex: 1">
            <div class="title" v-if="detail.type == 0">
              <el-image style="width: 160px; height: 22px" :src="require('@/assets/arrowhead.png')" :fit="'fill'"></el-image>
            </div>
            <div class="title-content  flex flexC flexJp">
              <div>
                <span>揽件人：{{detail.employee_name}}</span>
                <span v-if="detail.type == 0" class="cp more" @click="()=>{
                 this.$toRoutePath({
                  path: '/employee_list/employee_list_detail',
                  edit: true,
                  query: {type:1,employee_id:detail.employee_id}
              })}">更多信息</span>
              </div>
              <div>
                <span>揽件人联系方式：</span>
                <span>{{detail.employee_mobile}}</span>
              </div>
               <div>
                <span>揽件时间：</span>
                <span>{{detail.post_time}}</span>
              </div>
            </div>
          </div>

          <div style="flex: 1">
            <div class="title" v-if="detail.type == 0">{{detail.arrive_region_name}}</div>
            <div class="title-content  flex flexC flexJp">
              <div>
                <span>收件人：{{detail.receive_communicate_name}}</span>
                <span class="cp more"></span>
              </div>
              <div>
                <span>收件人联系方式：</span>
                <span>{{detail.receive_communicate_mobile}}</span>
              </div>
              <div v-if="detail.type != 0">
                <span>收件地址：</span>
                <span>{{detail.arrive_address}}</span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- 验收图 -->
    <div class="check_img">
      <viewTitle :title="'验收照片'"></viewTitle>
      <div class="check_img_flex">
        <el-form ref="form" label-width="auto" :inline="true">
          <div class="flex flexR">
            <div class="cardL" v-if="detail.type == 0">
            <el-form-item label="寄件拍摄:">
<!--              <el-image width="10rem"-->
<!--                        height="10rem"-->
<!--                        fit="contain" :src="detail.member_pictures[0]" @click="$imgPreview"></el-image>-->
              <img
                  :src="detail.member_pictures[0]"
                  v-default-img
              />
            </el-form-item>
            </div>
            <div class="cardL">
              <el-form-item label="揽件拍摄:">
<!--                <el-image width="10rem"-->
<!--                          height="10rem"-->
<!--                          fit="contain" :src="detail.employee_pictures ? detail.employee_pictures[0]:''" @click="$imgPreview"></el-image>-->
                <img
                    :src="detail.employee_pictures[0]"
                    v-default-img
                />
              </el-form-item>
            </div>
          </div>
        </el-form>
      </div>
    </div>
    <div class="footer_btn">
      <el-button v-if="this.detail.is_dubious == 0" type="warning" @click="doDubious">标记为可疑件</el-button>
      <el-button v-if="this.detail.is_dubious == 1 && this.detail.handle_status == 0" type="primary" @click="doHandle">标记为已处理</el-button>
    </div>

  </views>
</template>


<script>
export default {
  data() {
    return {
        detail:{}
    };
  },
  methods: {
      getData(){
        let post_data={
           logistics_id:this.$route.query.logistics_id||0
        }
         this.$raxios.post(
              this.$mapapi.admin_logisticsDetail,{
                  data:post_data
              }).then(res=>{
                if(res.code==200){
                 this.detail = res.data;
                }else{
                this.detail = [];
	                this.$message.error(res.msg)
                return;
                }
              }).catch(res=>{

              })
        
      },
      doDubious(){
        let post_data={
                 logistics_id:this.detail.logistics_id||0
          }
          this.$raxios.post(
              this.$mapapi.admin_doDubious,{
                   data:post_data
              }).then(res=>{
                if(res.code==200){
                 this.$message.success('标记可疑件成功')
                 this.getData();
                }else{
                     this.$message.error(res.msg)
                 return;
                }
              }).catch(res=>{

              })
      },
      doHandle(){
          let post_data={
                 logistics_id:this.detail.logistics_id||0
          }
          this.$raxios.post(
             this.$mapapi.admin_doHandle,{
                   data:post_data
              }).then(res=>{
                if(res.code==200){
                 this.$message.success('标记可疑件成功')
                 this.getData();
                }else{
                     this.$message.error(res.msg)
                 return;
                }
              }).catch(res=>{

              })
      }
  },
  created() {},
  mounted() {
      this.getData();
  }
};
</script>

<style lang="less" src="@/style/logistics_manager/logistics_list_detail.less">
</style>
